﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Profile.cs" company="DissingNelleman">
//   
// All rights reserved. </copyright>
// <summary>
//   The profile.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace ServiceLibrary.Models.Domain
{
    using NHibernate.Mapping.ByCode.Conformist;

    using ServiceLibrary.Models.Base;

    /// <summary>
    /// The profile.
    /// </summary>
    public class Profile : Entity
    {
        #region Public Properties

        /// <summary>
        /// Gets or sets the cvr.
        /// </summary>
        public virtual string CVR { get; set; }

        /// <summary>
        /// Gets or sets the contact type.
        /// </summary>
        public virtual ProfileContactType ContactType { get; set; }

        /// <summary>
        /// Gets or sets the location.
        /// </summary>
        public virtual Location Location { get; set; }

        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        public virtual string Name { get; set; }

        /// <summary>
        /// Gets or sets the relation.
        /// </summary>
        public virtual ProfileRelation Relation { get; set; }

        /// <summary>
        /// Gets or sets the sub type.
        /// </summary>
        public virtual ProfileSubtype SubType { get; set; }

        public virtual bool Within150km { get; set; }

        public virtual bool IsRemoteArea { get; set; }

        public virtual bool IsEntrepreneur { get; set; }

        public virtual Region Region { get; set; }
        #endregion
    }

    /// <summary>
    /// The profile mapping.
    /// </summary>
    public class ProfileMapping : ClassMapping<Profile>
    {
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="ProfileMapping"/> class.
        /// </summary>
        public ProfileMapping()
        {
            this.Property(x => x.Within150km);
            this.Property(x => x.IsEntrepreneur);
            this.Property(x => x.IsRemoteArea);
            this.ManyToOne(x => x.Region);
            this.Property(x => x.Name);
            this.Property(x => x.CVR);
            this.ManyToOne(x => x.Relation);
            this.ManyToOne(x => x.SubType);
            this.ManyToOne(x => x.Location);
            this.ManyToOne(x => x.ContactType);
        }

        #endregion
    }
}